﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;

namespace Page.Objects
{
    public class InternalPage : AnyPage
    {
        [FindsBy(How=How.XPath, Using="//a[contains(@href, 'logout')]")]
        public IWebElement MenuLogOutLink;

        [FindsBy(How = How.XPath, Using = "//a[contains(@href, 'profile')]")]
        public IWebElement MenuProfileLink;

        [FindsBy(How = How.XPath, Using = "//a[contains(@href, 'users')]")] 
        public IWebElement MenuUserManageLink;

        [FindsBy(How = How.XPath, Using = "//header//nav//ul//li[1]")] //supposes that it's always first element in menu
        public IWebElement MenuHomeLink;

        [FindsBy(How = How.XPath, Using = "//header//a/h1")] 
        public IWebElement Header;

        public bool IsOnThisPage()
        {
            return MenuLogOutLink.Displayed;
        }
    }
}
